# 导入flask_script扩展包-->使程序在命令窗口运行
from flask_script import Manager

# 导入flask_migrate扩展包
from flask_migrate import Migrate,MigrateCommand

# 导入程序实例app
from info import create_app,db

app = create_app('development')

# 实例化管理器对象
manager = Manager(app)
# 实例化迁移对象-->第一个参数是Flask实例对象,第二个参数是数据库SQLAlchemy实例对象
Migrate(app,db)
# 添加迁移命令
manager.add_command('db',MigrateCommand)


if __name__ == '__main__':
    # app.run(debug=1)
    print(app.url_map)
    manager.run()